package br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.home.info;

import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;
import br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.Updatable;
import br.edu.ufcg.lsd.wbis.ui.client.ui.management.InfoManager;

import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;

/**
 * @author Renato Miceli
 */
public class UpdatePersonalInfoButtonListener extends ButtonListenerAdapter {

	private final InfoManager<UserInfo> infoManager;

	private final Updatable<UserInfo> parentPortlet;

	private final InfoManager<UserInfo> loggedInfoManager;

	public UpdatePersonalInfoButtonListener(Updatable<UserInfo> parentPortlet, InfoManager<UserInfo> infoManager,
			InfoManager<UserInfo> logedInfoManager) {
		this.parentPortlet = parentPortlet;
		this.infoManager = infoManager;
		this.loggedInfoManager = logedInfoManager;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void onClick(Button button, EventObject e) {
		new UpdatePersonalInfoWindow(this.parentPortlet, this.infoManager, this.loggedInfoManager);
	}
}
